const express = require('express')
// 创建路由对象
const router = express.Router()

// 导入订单路由处理函数模块
const orderHandler = require('../router_handler/order')

router.post('/getOrderMessage',orderHandler.getOrderMessage) //获取order表所以信息

router.get('/getUserName/:user_id',orderHandler.getUserName) //根据user_id获取用户姓名
router.get('/getRoomName/:room_id',orderHandler.getRoomName) //根据room_id获取房间名称
router.get('/delorderMessage/:order_id',orderHandler.delorderMessage) //刪除orders数据
router.get('/delPaymentsMessage/:order_id',orderHandler.delPaymentsMessage) //刪除Payments数据

//优惠券
router.get('/getCouponsMessage',orderHandler.getCouponsMessage)
router.get('/delCouponsMessage/:coupon_code',orderHandler.delCouponsMessage)
router.post('/insertCoupon',orderHandler.insertCoupon)
router.post('/updataCoupon',orderHandler.updataCoupon)

// 将路由对象共享出去
module.exports = router